﻿using BaseTool;
using OpenCvSharp;
using OpenCvSharp.Extensions;
using System;
using System.Windows.Forms;

namespace StructuredLightSystemUI
{
    /// <summary>
    /// 图像窗口
    /// </summary>
    public partial class ImageForm : InnerForm
    {
        /// <summary> 传入图像 </summary>
        private Mat Image = null;

        #region 构造、初始化
        /// <summary>
        /// 构造
        /// </summary>
        public ImageForm()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="image">图像</param>
        public ImageForm(Mat image)
        {
            InitializeComponent();

            this.Image = image;
        }
        //加载
        private void ImageForm_Load(object sender, EventArgs e)
        {

        }
        //显示
        private void ImageForm_Shown(object sender, EventArgs e)
        {
            if (Image != null)
                conPictureBox1.ShowImage = Image.ToBitmap();
        }
        //正在关闭
        private void ImageForm_FormClosing(object sender, FormClosingEventArgs e)
        {

        }
        //已关闭
        private void ImageForm_FormClosed(object sender, FormClosedEventArgs e)
        {

        }
        #endregion
    }
}
